package com.loong.controller;

import com.loong.entity.Greeting;
import com.loong.service.impl.GreetingServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/greeting")
public class GreetingController {

    @Autowired
    private GreetingServiceImpl greetingService;
    @GetMapping("/hello")
    public String greeting() {
        List<Greeting> list = greetingService.list();
        return list.get(list.size()-1).getContent();
    }
}
